#include <string>

// a base class that is used by Serializer and Searcher.
template <typename MappedMemory>
struct IndexAccessor {
	MappedMemory* wordtree_file;
	MappedMemory* moreinfo_file;
	MappedMemory* postings_file;
	MappedMemory* documents_file;
	MappedMemory* paths_file;
	
	IndexAccessor() : wordtree_file(NULL), moreinfo_file(NULL),
		postings_file(NULL), documents_file(NULL), paths_file(NULL) {}
	void set_wordtree_file(MappedMemory* mem) {
		wordtree_file = mem;
	}
	void set_moreinfo_file(MappedMemory* moreinfo) {
		moreinfo_file = moreinfo;
	}
	void set_postings_file(MappedMemory* postings) {
		postings_file = postings;
	}
	void set_documents_file(MappedMemory* docs) {
		documents_file = docs;
	}
	void set_paths_file(MappedMemory* paths) {
		paths_file = paths;
	}
};

